package IO.Buffered.BufferedReader;

import java.io.BufferedReader;
import java.io.FileReader;

/*
* 缓冲字符输入流BufferedReader
*
*
* */
public class Demo1 {
    public static void main(String[] args) throws Exception{
        try(
                //1、创建BufferedReader对象
                BufferedReader br = new BufferedReader(new FileReader("Day06/src/IO/Buffered/BufferedReader/test.txt"));

        ) {
            //readLine()只能读取一行数据
            System.out.println(br.readLine());
            System.out.println(br.readLine());
            System.out.println(br.readLine());
            System.out.println(br.readLine());
            System.out.println(br.readLine());// null  说明文本文件已经读完
        }catch (Exception e) {
            e.printStackTrace();
        }
    }
}
